//
//  UIView+Category.h
//  dudu_oc_master
//
//  Created by mac on 2019/11/11.
//  Copyright © 2019 Shawn Ma. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIView (Category)

@property (assign, nonatomic) CGFloat tj_x;
@property (assign, nonatomic) CGFloat tj_y;
@property (assign, nonatomic) CGFloat tj_width;
@property (assign, nonatomic) CGFloat tj_height;
@property (assign, nonatomic) CGFloat tj_centerX;
@property (assign, nonatomic) CGFloat tj_centerY;
@property (assign, nonatomic) CGFloat tj_top;
@property (assign, nonatomic) CGFloat tj_bottom;
@property (assign, nonatomic) CGSize  tj_size;
@property (assign, nonatomic, readonly) CGFloat tj_MaxX;
@property (assign, nonatomic, readonly) CGFloat tj_MaxY;


+ (_Nonnull instancetype)addToView:(nonnull UIView *)superView;
+ (_Nonnull instancetype)buttonWithSuperView:(nullable UIView *)superView font:(UIFont *)font color:(nullable UIColor *)color title:(nullable NSString *)title;
+ (_Nonnull instancetype)lableWithSuperView:(nullable UIView *)superView font:(UIFont *)font color:(nullable UIColor *)color title:(nullable NSString *)title textAlignment:(NSTextAlignment)textAlignment;

- (UITapGestureRecognizer *)addTapGesturesWithTarget:(nullable id)id action:(nonnull SEL)action;
- (UILongPressGestureRecognizer *)addLongPressGesturesWithTarget:(id)id action:(SEL)action;

- (void)addRoundingCorners:(UIRectCorner)corners radius:(CGFloat)radius;

- (instancetype (^)(UIView *superView))addTo;
- (instancetype (^)(CGFloat radius))addCornerRadius;
- (UIViewController *)viewController;

- (CAShapeLayer *)shapeLayerRoundingCorners:(UIRectCorner)corners radius:(CGFloat)radius;

- (CAShapeLayer *)shapeLayerRoundingCorners:(UIRectCorner)corners rect:(CGRect)rect radius:(CGFloat)radius;
- (void)removeAllSubview;

@end

NS_ASSUME_NONNULL_END
